package com.woniu.product.controller;

import com.woniu.product.entity.Product;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author SuperYu  2024/9/26
 */
@RestController
public class ProductController {

    @Value("${server.port}")
    String port;


    @RequestMapping("/product/{id}")
    public Product findProductById(@PathVariable int id){
        Product p = new Product();
        p.setId(id);
        p.setName("产品测试");
        p.setPrice(99.99);
        p.setPort(port);

        return p;
    }

}
